﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
		<html>
			<head>
				<title>
					你好啊
				</title>
				<link href="css.css" rel="stylesheet" type="text/css" />
			</head>
			<body>
			
				<h1>the first document for xml</h1>
				<p>
					<strong><!--开始定义文档结构-->
						摘要：
					</strong>
					<xsl:value-of select="*/form/li"/><!--找到所有的li原素-->
				</p>
				<xsl:apply-templates select="data"></xsl:apply-templates>

				<xsl:text disable-output-escaping="yes" xml:space="default">

				</xsl:text>
				<div id="ou"></div>
			</body>
			<script >
				setTimeout("document.getElementById(\"ou\").innerText = document.body.innerHTML;",5000)
			</script>
		</html>
    </xsl:template>

	<xsl:template match="data/form/li/span">
		<table>
			<tr>
				<td>
					 id
				</td>
				<td>
					产品名
				</td>
				<td>
					 内容
				</td>
			</tr>
			<xsl:for-each select="tab">
				<tr>
				<td>
					<xsl:value-of select="id"/><!-- xsl value-->
				</td>
				<td><!-- add to link-->
					<a>
					
						<xsl:attribute name="href">
							<!--
							<xsl:value-of select="link"/>
							-->
						</xsl:attribute>
						<xsl:value-of select="p" />
					</a>
					</td>
				<td>
					<xsl:value-of select="cont"/>
				</td>
			</tr>
			</xsl:for-each>

		</table>
	</xsl:template>
	

</xsl:stylesheet>
